<%-- 
    Document   : Modulo1Update
    Created on : 08-oct-2011, 6:04:21
    Author     : PC-01
--%>
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    Connection conn = null;
    try {
        String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
        Class.forName("com.mysql.jdbc.Driver");
        conn = DriverManager.getConnection(sc);
        System.out.println("Conectado");
        
        %>
        
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Actualizar</title>
    </head>
    <body>
        <form action="Modulo1UpdateDB.jsp">
            <table width="267" border="0" align="center">
                <% 
                    String `User`id = request.getParameter("`User`id");
                    String qry = "select * from `User` where `User`id='" + `User`id + "'";
                    PreparedStatement ps = conn.prepareStatement(qry);
                    ResultSet rs = ps.executeQuery();
                while (rs.next()) {%>
                <tr>
                    <th colspan="2" bgcolor="#B8AA03" scope="col">Actualizar Tabla</th>
                    <input type="password" name="`User`id" id="`User`id" value="<%= `User`id%>">;
                </tr>
                <tr>
                    <td width="113" align="right" bgcolor="#DDDD00">Photo  :</td>
                    <td width="144" bgcolor="#DDDD00"><input type="text" name="Photo  " id="Photo  " value="<%= rs.getString("Photo  ")%>"/></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#DDDD00">`Name` :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="`Name` " id="`Name` " value="<%= rs.getString("`Name` ")%>"/></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#DDDD00">Email :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="Email " id="Email " value="<%= rs.getString("Email ")%>"></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#DDDD00">Cellular:</td>
                    <td bgcolor="#DDDD00"><input type="text" name="Cellular" id="Cellular" value="<%= rs.getString("Cellular")%>"></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#DDDD00">Login :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="Login " id="Login " value="<%= rs.getString("Login ")%>"></td>
                </tr>
                
                 <tr>
                    <td align="right" bgcolor="#DDDD00">Password :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="Password " id="Password " value="<%= rs.getString("Password ")%>"></td>
                </tr>
                 <tr>
                    <td align="right" bgcolor="#DDDD00">Login :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="Privilege " id="Privilege " value="<%= rs.getString("Privilege ")%>"></td>
                </tr>
                 <tr>
                    <td align="right" bgcolor="#DDDD00">Login :</td>
                    <td bgcolor="#DDDD00"><input type="text" name="ActiveAccount " id="ActiveAccount " value="<%= rs.getString("ActiveAcount")%>"></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <%
                        }
                    } catch (Exception e) {
                        out.print("Error: " + e.getMessage());
                    }
                %>

                <tr>
                    <td colspan="2"><label for="textfield">
                            <input type="submit" value="Actualizar"/>
                        </label></td>
                </tr>

            </table>
        </form>
    </body>
</html>
